package com.elitel.common.auth.controller;

import com.elitel.common.core.domain.SysUserInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 登录接口规范 具体登录逻辑最好实现此接口
 */
public interface CommonLoginController {

    /**
     * 登出业务逻辑
     *
     * @param request
     * @param response
     * @return 登出成功，返回true，否则返回false
     */
    default boolean doLogout(HttpServletRequest request, HttpServletResponse response) {
        return true;
    }

    /**
     * 登录业务逻辑
     *
     * @param request
     * @param response
     * @param params   登录参数
     * @return 登录成功 返回true，否则返回false
     */
    SysUserInfo doLogin(HttpServletRequest request, HttpServletResponse response, SysUserInfo params);


}
